			<!-- END CONTENT -->
			<p><br clear="all" /></p>
		</div>
		
		<div class="sidebar">
		
<?php	
 if (isset($_SESSION['user_id'])) {
	// Show basic user options:
	echo '<div class="title">
				<h4>Manage Your Account</h4>
			</div>
			<ul>
			<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>
			<li><a href="change_password.php" title="Change Your Password">Change Password</a></li>
			<li><a href="favorites.php" title="View Your Favorite Pages">Favorites</a></li>
			<li><a href="history.php" title="View Your History">History</a></li>
			<li><a href="recommendations.php" title="View Your Recommendations">Recommendations</a></li>
			<li><a href="logout.php" title="Logout">Logout</a></li>
			</ul>
			';
			
	// Show admin options, if appropriate:
	if (isset($_SESSION['user_admin'])) {
		echo '<div class="title">
					<h4>Administration</h4>
				</div>
				<ul>
				<li><a href="add_page.php" title="Add a Page">Add Page</a></li>
				</ul>
				';		
	}
					
} else { // Show the login form:
	
	require ('includes/login_form.inc.php');
	
}
?>	

			<div class="title">
				<h4>Content</h4>
			</div>
			<ul>
<?php // Dynamically generate the content links:
$q = 'SELECT * FROM shop_categories ORDER BY category';
$r = mysqli_query($dbc, $q);


while (list($id, $category) = mysqli_fetch_array($r, MYSQLI_NUM)) {

	echo '<li><a href="category.php?id=' . $id . '" title="' . $category . '">' . $category . '</a></li>';
}
?>	
		</div>

		<div class="footer">footer</div>
		
		<!-- end of layout div at header file -->
		</div>
	</div>
	</body>
</html>	